]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Clean up reposition
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 21 Dec 2012 14:05:34 +0000 (09:05 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 21 Dec 2012 17:24:48 +0000 (12:24 -0500)
Given that it's modifying state, there's no reason it can't be
using it instead. This makes it easier to use, so we aren't passing
in a bunch of instance variables every time.

https://bugzilla.gnome.org/show_bug.cgi?id=690608

js/ui/boxpointer.js

index 01bc2c8d8ed0ae7d33f0b6c0aec5d5bb773ca692..db82449003fe15e36993fc496e32f270d6e41f52 100644 (file)
@@ -220,7 +220,7 @@ const BoxPointer = new Lang.Class({
         this.bin.allocate(childBox, flags);
 
         if (this._sourceActor && this._sourceActor.mapped) {
-            this._reposition(this._sourceActor, this._arrowAlignment);
+            this._reposition();
 
             if (this._shouldFlip()) {
                 switch (this._arrowSide) {
@@ -237,7 +237,7 @@ const BoxPointer = new Lang.Class({
                     this._arrowSide = St.Side.LEFT;
                     break;
                 }
-                this._reposition(this._sourceActor, this._arrowAlignment);
+                this._reposition();
             }
         }
     },
@@ -417,7 +417,7 @@ const BoxPointer = new Lang.Class({
         this._sourceActor = sourceActor;
         this._arrowAlignment = alignment;
 
-        this._reposition(sourceActor, alignment);
+        this._reposition();
     },
 
     setSourceAlignment: function(alignment) {
@@ -429,7 +429,10 @@ const BoxPointer = new Lang.Class({
         this.setPosition(this._sourceActor, this._arrowAlignment);
     },
 
-    _reposition: function(sourceActor, alignment) {
+    _reposition: function() {
+        let sourceActor = this._sourceActor;
+        let alignment = this._arrowAlignment;
+
         // Position correctly relative to the sourceActor
         let sourceNode = sourceActor.get_theme_node();
         let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());